package com.zhao.dota.vo;

import cn.hutool.core.bean.BeanUtil;
import com.zhao.dota.model.Hero;
import com.zhao.dota.util.SteamUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class HeroVo extends Hero implements Serializable {

    private Integer userId;

    private String avatar;

    private String avatarFull;

    public HeroVo(Hero hero) {
        BeanUtil.copyProperties(hero, this);
        this.avatar = SteamUtil.getIconUrlByHeroName(super.getName());
        this.avatarFull = SteamUtil.getIconUrlByHeroName(super.getName());
    }

    public void setAvatar() {
        this.avatar = SteamUtil.getIconUrlByHeroName(super.getName());
        this.avatarFull = SteamUtil.getIconUrlByHeroName(super.getName());
    }

}
